Scala.js: Type-Directed Interoperability with Dynamically Typed Languages

نویسنده

  • Sébastien Doeraene
چکیده

Interoperability between statically typed and dynamically typed languages is increasingly important, as can be witnessed by the many statically typed languages targeting JavaScript. Interoperating with both the object-oriented and functional features of JavaScript is essential, if only to manipulate the DOM, yet existing languages have very poor support for this. We present Scala.js, a dialect of Scala compiling to JavaScript. Its interoperability system is based on a powerful and intuitive framework for type-directed interoperability with dynamically typed languages. The framework combines facade types for JavaScript values; user-defined, implicit, type-directed cross-language conversions; and a Dynamic type building on facade types and implicit conversions. It accommodates both the functional and objectoriented features of Scala and JavaScript, and provides very natural interoperability between the two languages. It is expressive enough to represent the DOM and jQuery APIs, among others, both in its statically typed and dynamically typed flavors.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Reconciling method overloading and dynamically typed scripting languages

The Java Virtual Machine (JVM) has been adopted as the executing platform by a large number of dynamically typed programming languages. For example, Scheme, Ruby, Javascript, Lisp, and Basic have been successfully implemented on the JVM and each is supported by a large community. Interoperability with Java is one important requirement shared by all these languages. We claim that the lack of typ...

متن کامل

Online Type-Directed Partial Evaluation for Dynamically-Typed Languages∗

This article presents an alternative method of type-directed partial evaluation, which is simpler and more efficient than previous methods. Unlike previous methods, it is straightforwardly applicable to functional languages with various powerful type systems. As an extreme instance, this article mainly deals with a dynamically-typed functional language like Scheme. The key idea is to extend pri...

متن کامل

Static type information to improve the IDE features of hybrid dynamically and statically typed languages

The flexibility offered by dynamically typed programming languages has been appropriately used to develop specific scenarios where dynamic adaptability is an important issue. This has made some existing statically typed languages gradually incorporate more dynamic features to their implementations. As a result, there are some programming languages considered hybrid dynamically and statically ty...

متن کامل

Language Interoperability Safe C++

Most software systems are created not with a single language but instead with a collection of languages each carefully chosen to solve a particular set of problems within those systems. Typically the facilities for these languages to interoperate are constructed in an ah-hoc fashion and are thus tedious to use, error-prone, and do not preserve the safety properties of the languages involved. I ...

متن کامل

Efficient Just-In-Time Execution of Dynamically Typed Languages Via Code Specialization Using Precise Runtime Type Inference

Dynamically typed languages such as JavaScript present a challenge to just-in-time compilers. In contrast to statically typed languages such as JVML, in which there are specific opcodes for common operations on primitive types (such as iadd for integer addition), all operations in dynamically typed language such as JavaScript are late-bound. Often enough, types cannot be inferred with certainty...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013